import { stringify } from 'qs';
import request from '@/utils/request';

export async function repetition(params) {
  return request('/shardUpload/repetition', {
    method: 'POST',
    data: params,
  });
}
export async function uploadFilePart(params) {
  return request('/shardUpload/uploadfilepart', {
    method: 'POST',
    data: params,
  });
}
export async function merge(params) {
  return request('/shardUpload/merge', {
    method: 'POST',
    data: params,
  });
}
export async function fetchPercentByMd5(params) {
  return request(`r:cms/shardUpload/percent?${stringify(params)}`, {
    method: 'GET',
  });
}
export async function deleteFile(params) {
  return request(`/shardUpload/delete/${params}`, {
    method: 'PUT',
  });
}
export async function breakFile(params) {
  return request(`/shardUpload/break/${params}`, {
    method: 'PUT',
  });
}

export async function getUploadFile(params) {
  return request(`/shardUpload/getRecord?${stringify(params)}`, {
    method: 'GET',
  });
}

export async function uploadinstallpackage(params) {
   return request(`r:cms/shardUpload/uploadinstallpackage`, {
    method: 'POST',
    data: params,
  });
}
